<?php
    echo $this->flashMessage()->renderMessages(); 
?>

<div class="header_wrapper">
    <h1>Kontingent for <?php echo $this->year; ?></h1>
    <?php echo $this->filterForm; ?>
</div>

<form id="add_payment_to_members" method="post" action="<?php echo $this->url(array('module' => 'admin', 'controller' => 'membership-fee', 'action' => 'set-payment'), null, false); ?>">

<table id="membership_fee_members">
    <thead>
        <tr>
            <th>&nbsp;</th>
            <th>Navn</th>
            <th>Betalt</th>
        </tr>
    </thead>
    <tbody>
    <?php foreach ($this->members as $member): ?>
    <?php
        $info = null;
        foreach ($member->MembershipFees as $fees):
            if ($fees->year == $this->year):
                $info = $fees;
            endif;
        endforeach;
    ?>
        <tr>
        <td class="checkbox"><input type="checkbox" id="member_<?php echo $member->id; ?>" name="members[]" value="<?php echo $member->id; ?>" /></td>
        <td><label for="member_<?php echo $member->id; ?>"><?php echo $this->escape($member->first_name . ' ' . $member->last_name); ?></label></td>
        <?php
            if ($info != null):
                $date = new RedCross_Date();
                $date->import($info->date_paid);
                $date = $this->escape($date->getDateTimeStr());
                echo '<td class="green">' . $date . '</td>';
            else:
                echo '<td></td>';
            endif;
        ?>
        </tr>
    <?php endforeach; ?>
    </tbody>
</table>

<p>&nbsp;</p>

<input type="submit" value="Registrer betaling" name="add_payment_for_members" id="add" class="positive" />
<input type="submit" value="Fjern registrert betaling" name="remove_payment_for_members" id="remove" class="negative" />

</form>

<p>&nbsp;</p>
    <p><strong>Kontingentoversikten er ikke garantert oppdatert eller fullstendige.</strong></p>&nbsp;
